import numpy as np
import pandas as pd
import random

import matplotlib.pyplot as plt
import seaborn as sns

df = pd.read_csv('https://media.githubusercontent.com/media/an-nightingale/max/main/dmp.csv', names=['id', 'id_order', 'id_driver', 'c_date', 'c_speed', 'c_lat', 'c_lon', 'c_vector', 'c_precision'])

df['c_date'] = pd.to_datetime(df['c_date'], format="%Y-%m-%d %H:%M:%S.%f%z", errors='coerce')

df['year'] = df['c_date'].dt.year
df['month'] = df['c_date'].dt.month
df['day'] = df['c_date'].dt.day
df['hour'] = df['c_date'].dt.hour
df['minute'] = df['c_date'].dt.minute
df['second'] = df['c_date'].dt.second
df['weekday'] = df['c_date'].dt.weekday + 1 # добавление дня недели - посмотреть разницу между буднями и выходными
df = df.drop('c_date', axis=1)

correlation_matrix = df.corr()
sns.heatmap(correlation_matrix, annot=True, cmap="coolwarm")
plt.title("Correlation Matrix")
plt.show()
